<template>
	<view class="black_1" >
		<!-- #ifdef H5 -->
		<!-- <iframe width="100%" height="100%" :src="src" :title="title" /> -->
		<!-- #endif -->
		<!-- #ifndef APP-PLUS -->
		<!-- <web-view :webview-styles="wbStyles" :src="src" :fullscreen="true" /> -->
		<!-- <iframe width="100%" height="100%" :style="wbStyles" :src="src" :title="title" /> -->
		<!-- #endif -->
		<iframe width="100%" height="100%" :style="wbStyles" :src="src" :title="title" />
		<!-- <web-view :src="src"></web-view> -->
		<view class="black_2" @click="back()">{{codeTime_text}}</view>
		

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '抽奖',
				src: 'https://activity14.zaryd12.com/activity/index?id=35383&slotId=407159&login=normal&appKey=24vi65o36eqGzWdubftTQ1YDRViw&deviceId=19a280a6-ed69-46eb-911f-e3895fc8194f&dsm=1.407159.0.0&dsm2=1.407159.2.35383&tenter=SOW&subActivityWay=48&tck_rid_6c8=0adcac79lkutbspr-11567255&tck_loc_c5d=tactivity-35383&dcm=401.407159.0.0&netType=2&tenter=SOW&visType=0&specialType=0&sourcePage=35383&deviceIdType=2&formUserId=null&isTestActivityType=0&algoType=42&userType=2&ep=sTYs_9r-PKq8yCb4_oZ_ZpMjtHimvAXoExS-6j_lXzcJpCk4qdAJWDaCjru9nBvRzPXHKXiQ3QF_bIPdQ2SMsA==&iframe=1&openStyleType=1892&sign=FEF03E23F77AB683785AFCACF43AB10E',
				wbStyles: {
					width: '100%',
					height: '100%',
					position: 'absolute',
				},
				codeTime:25,
				codeTime_text:"30S后领取奖励",
				inter:null
			}
			
		},
		onLoad(option) {
			this.codeTime = Number(option.second)
			this.codeTime_text = this.codeTime+"S后领取奖励"
			this.src = uni.getStorageSync('adv_url')
			this.getTextCode()
		},
		methods:{
			back(){
				if(this.codeTime <=0){
					this.custom.tool.jump(3,'index/index')
				}
			},
			getTextCode(){
			  var that =this
				that.inter =setInterval(function() {
					if (that.codeTime <= 0) {
						that.codeTime  = 0
						clearInterval(that.inter);
						that.codeTime_text = "X"
						uni.$emit('paySuccsse', {
							type: 2,
							msg: ""
						})
						// that.custom.tool.jump(3,'index/index')
						return false;
					}
					
					that.codeTime -= 1;
					that.codeTime_text = that.codeTime+"S后领取奖励"
				}, 1000);
			},
		},
		onUnload() {
			if(this.inter){
				clearInterval(this.inter);
			}
		}
	}
</script>
<style lang="less">
	page {
		width: 100%;
		height: 100%;
	}

	.black_1 {
		width: 100%;
		height: 100%;
		
	}
	
	.black_2{
		position: absolute;
		right: 10px;
		padding: 1px 5px;
		color: white;
		margin-top: 10px;
		border-radius: 10px;
		background-color: #00000050;
		//#ifdef H5
		    top: 10px;
		//#endif
	}
	
</style>